package org.desktop.web.client.project.proxy;

import org.desktop.web.client.project.service.ProjectService;
import org.desktop.web.client.project.service.ProjectServiceAsync;
import org.desktop.web.shared.domain.entities.SubProject;

import com.google.gwt.core.shared.GWT;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.data.client.loader.RpcProxy;
import com.sencha.gxt.data.shared.loader.FilterPagingLoadConfig;
import com.sencha.gxt.data.shared.loader.PagingLoadResult;
import com.sencha.gxt.widget.core.client.info.Info;

public class RpcSubProjectProxy extends
		RpcProxy<FilterPagingLoadConfig, PagingLoadResult<SubProject>> {

	private String id;

	ProjectServiceAsync service = GWT.create(ProjectService.class);

	@Override
	public void load(FilterPagingLoadConfig loadConfig,
			AsyncCallback<PagingLoadResult<SubProject>> callback) {
		// TODO Auto-generated method stub
		if (id != null) {
			service.getSubProjectsByIdProject(Cookies.getCookie("token"), id,
					loadConfig, callback);
		}

	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

}
